Public Class SNForm

    Private Sub SNForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If g_isPaidMode Then
            ' User doesn't need this screen, exit
            ' Pirates shouldn't be permitted to change serial before found to be invalid either...
            MsgBox("You have already purchased this program.  Thank you for using " & My.Application.Info.AssemblyName, MsgBoxStyle.Information + MsgBoxStyle.OkOnly, My.Application.Info.AssemblyName)
            Me.Dispose()
        End If

        Me.Text = "Purchase " & My.Application.Info.AssemblyName
    End Sub

    Private Sub lnkPurchase_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lnkPurchase.LinkClicked
        gotoPurchaseWebsite()
    End Sub

    Private Sub lnkPrivacyPolicy_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lnkPrivacyPolicy.LinkClicked
        gotoPrivacyPolicy()
    End Sub

    Private Sub lnkHelp_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lnkHelp.LinkClicked
        gotoHelpWebsite()
    End Sub

    Private Sub butVerifySerial_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butVerifySerial.Click
        Static objSerial As New clsSerial

        If Not objSerial.VerifySerial(txtSerial.Text) Then
            MsgBox("The serial number you provided is incorrect.  Please ensure you did not mis-type anything and try again.  No features were unlocked at this time", MsgBoxStyle.Exclamation, My.Application.Info.AssemblyName)
        Else
            My.Settings.strSerialNumber = txtSerial.Text
            My.Settings.Save()
            g_isPaidMode = True
            MsgBox("Congratulations!" & vbNewLine & vbNewLine & "This program has been unlocked.  It is recommended you restart this program to enjoy all the new features you just purchased", MsgBoxStyle.Information, My.Application.Info.AssemblyName)
        End If
    End Sub

End Class